<template>
  <div class="plr20 mt80">
    <!-- <mt-form> -->
    <!-- <mt-field :attr="{ maxlength: 11 }" placeholder="请输入手机号" type="tel" v-model="form.userName"></mt-field>
    <mt-field class="b-bott" placeholder="请输入密码" type="password" v-model="form.passWord"></mt-field>
    <mt-field class="b-bott" placeholder="请再次输入密码" type="password" v-model="form.passWord2"></mt-field>
    <mt-button class="mt20" type="primary" @click="reg" size="large">注册</mt-button>
    <foot-Tab></foot-Tab> -->
    <!-- </mt-form> -->
  </div>
</template>

<script>
import { validate } from '@/util/validate'
import { Http } from '@/api/api'
import footTab from '@/components/footTab'
export default {
  components: { 'foot-Tab': footTab },
  data () {
    return {
      toastObj: null,
      phoneState: null,
      form: {
        userName: null,
        passWord: null,
        passWord2: null
      }
    }
  },
  methods: {
    reg () {
      let status = validate.checkVliate([
        { nameFun: 'isPhone', value: [this.form.userName] },
        { nameFun: 'checkpwd', value: [this.form.passWord, this.form.passWord2] }
      ])
      if (status) {
        this.$indicator.open()
        Http('post', '/aiyu/applogin/registerUserInfo', this.form).then((data) => {
          if (data.code !== '0000') {
            validate.msg(data.msg, 0)
          } else {
            this.$router.push({
              path: '/aiyu/login'
            })
          }
          this.$indicator.close()
        })
      }
    },

    footTab () {
    }
  },
  mounted () {
  },
  watch: {

  }
}
</script>
<style scoped>
</style>
